<% @page_title = l("Editing user '%s'", @user.login) %>

<h2><%= @page_title.capitalize %></h2>

<% unless @user.errors.empty? -%>
  <div id="ErrorExplanation">
    <h2><%= l("something gone wrong") %></h2>
    <ul>
    <% @user.errors.each do |attr, msg| -%>
      <li><%=h l(attr.capitalize) %> <%= l(msg) %></li>
    <% end -%>
    </ul>
  </div>
  <div class="clear"></div>
<% end -%>

<div id="edit-user">
  <%= form_tag :action => :edit %>
  <h2><%= l('Personal information')%></h2>
  <div>
    <label for="user_login"><%= l('Login') %><em class="required">*</em></label>
    <% if @user.login == 'admin' -%>
      <%= text_field :user, :login, :disabled => "disabled" %>
    <% else -%>
      <%= text_field :user, :login %>
    <% end -%>
  </div>
  <div>
    <label for="user_email"><%= l('Email') %><em class="required">*</em></label>
    <%= text_field :user, :email %>
  </div>
  <div>
    <label for="user_password"><%= l('Password') %><em class="required">*</em></label>
    <%= password_field :user, :password %>
  </div>
  <div>
    <label for="user_confirm"><%= l('Confirm') %><em class="required">*</em></label>
    <%= password_field :user, :password_confirmation %>
  </div>
  <div>
    <%= submit_tag l('validate'), :class => "button" %>
    <%= link_to l('cancel'), :action => 'list' %>
  </div>
  </form>
</div>

<div id="edit-user-roles">
  <%= form_tag :action => :edit_user_roles, :id => @user %>
  <%= display_roles_checkbox_two_columns(@user) %>
  <div>
    <%= submit_tag l('validate'), :class => "button" %>
    <%= link_to l('cancel'), :action => 'list' %>
  </div>
  </form>
</div>


